window.onload = function(){
	var height = $(window).height();
	$('body').height(height);
	var height2 = $('.scrollCont').offset().top;
	var height3 = $('.date-footer').height();
	$('.scrollCont').height(height - height2 - height3);
	var myScroll = new IScroll('#wrapper', {
	    mouseWheel: true,
	    scrollbars: false
	});
}
$(function(){
	$('.dep').on('tap',function(){
		$.post('/index/api/departmenList',{},function (data) {
			// console.log(data);
			if(data.code==200){
                var $str = '<div class="depList">';
                $.each(data.date,function (i,v) {
					$str +='<button class="mui-btn depBtn mui-pull-left" dataid="'+v.id+'">'+v.departmen_name+'</button>';
                });
                $str +='</div>';
                var index2 = layer.open({
                    title: [
                        '选择部门',
                        'background-color: #4990E2; color:#fff;'
                    ]
                    ,content: $str
                    // '<div class="depList">'+
                    // '<button class="mui-btn depBtn mui-pull-left">市场部</button>'+
                    // '<button class="mui-btn depBtn mui-pull-left">销售部</button>'+
                    // '<button class="mui-btn depBtn mui-pull-left">人事部</button>'+
                    // '<button class="mui-btn depBtn mui-pull-left">行政部</button>'+
                    // '<button class="mui-btn depBtn mui-pull-left">设计部</button>'+
                    // '</div>'
                });
			}else{
				mui.alert(data.msg);
			}
            $('.depBtn').on('tap',function(){
                var $str = $(this).attr('dataid');
                window.location.href = "/index/index/coreIntManage?department_id="+$str;
            })
        });
	})
	$('.cont ul li a').on('tap',function(){
		var url = $(this).attr('data-url');
		window.location.href = url;
	})
})
